package com.jay.io.clazz;

import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.PrintStream;

public class PrintStreamCls {
	public static void main(String[] args) throws FileNotFoundException {
		PrintStream ps = new PrintStream("out.txt");
		ps.append('a');
		ps.print(5);
		ps.println("wocao");

		ByteArrayOutputStream bs = new ByteArrayOutputStream();
		ps = new PrintStream(bs);
		ps.append('a');
		ps.print(5);
		ps.println("wocao");
		System.out.println(new String(bs.toByteArray()));
	}
}
